/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package actuatedocumentor;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author Richard
 */
public class OrderedHashMap extends HashMap {

    private ArrayList order;
    
    public OrderedHashMap() {
        order = new ArrayList();
    }

    @Override
    public void clear() {
        super.clear();
    }

    @Override
    public Object clone() {
        return super.clone();
    }

    @Override
    public boolean containsKey(Object key) {
        return super.containsKey(key);
    }

    @Override
    public boolean containsValue(Object value) {
        return super.containsValue(value);
    }

    @Override
    public Set entrySet() {
        return super.entrySet();
    }

    @Override
    public Object get(Object key) {
        return super.get(key);
    }

    @Override
    public boolean isEmpty() {
        return super.isEmpty();
    }

    @Override
    public Set keySet() {
        return super.keySet();
    }

    @Override
    public Object put(Object key, Object value) {
        order.add(key);
        return super.put(key, value);
    }
    
    
    public ArrayList getArrayList(){
       ArrayList al = new ArrayList();
        for(int i=0; i<order.size();i++){
           al.add(this.get(order.get(i)));
       }
       return al;
       
        
    }

    @Override
    public void putAll(Map m) {
        super.putAll(m);
    }

    @Override
    public Object remove(Object key) {
        return super.remove(key);
    }

    @Override
    public int size() {
        return super.size();
    }

    @Override
    public Collection values() {
        return super.values();
    }

    


}
